﻿Imports System.Runtime.CompilerServices

Public Module DataSetExtensions

    <Extension()> _
    Public Function GetChangedTables(ByVal ds As DataSet) As List(Of String)
        Dim tableNames As New List(Of String)
        For Each t As DataTable In Utility.Data.Tables
            Dim hasChanges As Boolean = False
            For Each r As DataRow In t.Rows
                If (r.RowState <> DataRowState.Unchanged) Then
                    hasChanges = True
                    Exit For
                End If
            Next
            If (hasChanges) Then tableNames.Add(t.TableName)
        Next
        Return tableNames
    End Function

End Module